package com.wlcorp.forcazamis.dao.sample.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ibatis.dao.client.DaoException;
import com.wlcorp.forcazamis.dao.sample.ISampleImageDAO;
import com.wlcorp.forcazamis.domain.sample.SampleImage;

public class SampleImageDAOImpl extends HibernateDaoSupport implements
		ISampleImageDAO {
	public void saveSampleImage(SampleImage sampleImage) throws DaoException{
		getHibernateTemplate().saveOrUpdate(sampleImage);
	}

	public void deleteSampleImage(SampleImage sampleImage) throws DaoException {
//		sampleImage.setDeleteFlag(true);
		getHibernateTemplate().delete(sampleImage);
	}

	public SampleImage getSampleImageById(Long sampleImageId) throws DaoException {
		return (SampleImage)getHibernateTemplate().get(SampleImage.class,sampleImageId);
	}
}
